﻿using System;
using System.Net;
using System.Collections.ObjectModel;

namespace FbHelperWP7NonUi.BookStorage.DropBoxStorage.AsyncHelpClasses
{
    internal sealed class GetDirectoryEntryResult : AbstractAsyncResult
    {
        private readonly ReadOnlyCollection<string> directories;
        private readonly ReadOnlyCollection<string> files;
        private readonly AsyncRequestCompleted<GetDirectoryEntryResult> callback;

        private GetDirectoryEntryResult( GetDirectoryEntryData data, ReadOnlyCollection<string> directories, ReadOnlyCollection<string> files, Exception error )
            : base( data, error )
        {
            this.directories = directories;
            this.files = files;
            this.callback = data.Callback;
        }

        public GetDirectoryEntryResult( GetDirectoryEntryData data, Exception error )
            : this( data, null, null, error )
        {
        }

        public GetDirectoryEntryResult( GetDirectoryEntryData data, ReadOnlyCollection<string> directories, ReadOnlyCollection<string> files )
            : this( data, directories, files, null )
        {
        }

        public ReadOnlyCollection<string> Directories
        {
            get
            {
                return directories;
            }
        }

        public ReadOnlyCollection<string> Files
        {
            get
            {
                return files;
            }
        }

        public AsyncRequestCompleted<GetDirectoryEntryResult> Callback
        {
            get
            {
                return callback;
            }
        }

    }
}
